package com.emcom.gotour.mvc.view;

import java.io.Serializable;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.springframework.context.MessageSource;

import com.emcom.gotour.mvc.message.SchedulerMessage;

public class SchedulerContentView implements Comparable<Object>, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 3657929231887917242L;
	private String id;
	private String tourId;
	private String name;
	private String content;
	private String dinner;
	private String hotel;
	private String comments;
	public SchedulerContentView() {
	}
	public SchedulerContentView(HttpServletRequest request, MessageSource messageSource) {
		this.id = SchedulerMessage.ID.value(request, messageSource);
		this.tourId = SchedulerMessage.TourId.value(request, messageSource);
		this.name = SchedulerMessage.Name.value(request, messageSource);
		this.content = SchedulerMessage.Content.value(request, messageSource);
		this.dinner = SchedulerMessage.Dinner.value(request, messageSource);
		this.hotel = SchedulerMessage.Hotel.value(request, messageSource);
		this.comments = SchedulerMessage.Comments.value(request, messageSource);
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getTourId() {
		return tourId;
	}
	public void setTourId(String tourId) {
		this.tourId = tourId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getDinner() {
		return dinner;
	}
	public void setDinner(String dinner) {
		this.dinner = dinner;
	}
	public String getHotel() {
		return hotel;
	}
	public void setHotel(String hotel) {
		this.hotel = hotel;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	/**
	 * @see java.lang.Comparable#compareTo(Object)
	 */
	public int compareTo(Object object) {
		SchedulerContentView myClass = (SchedulerContentView) object;
		return new CompareToBuilder().append(this.dinner, myClass.dinner)
				.append(this.content, myClass.content).append(this.id,
						myClass.id).append(this.name, myClass.name).append(
						this.hotel, myClass.hotel).append(this.comments,
						myClass.comments).append(this.tourId, myClass.tourId)
				.toComparison();
	}
	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof SchedulerContentView)) {
			return false;
		}
		SchedulerContentView rhs = (SchedulerContentView) object;
		return new EqualsBuilder().appendSuper(super.equals(object)).append(
				this.dinner, rhs.dinner).append(this.content, rhs.content)
				.append(this.id, rhs.id).append(this.name, rhs.name).append(
						this.hotel, rhs.hotel).append(this.comments,
						rhs.comments).append(this.tourId, rhs.tourId)
				.isEquals();
	}
	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(2142431615, -47223713).appendSuper(
				super.hashCode()).append(this.dinner).append(this.content)
				.append(this.id).append(this.name).append(this.hotel).append(
						this.comments).append(this.tourId).toHashCode();
	}
	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this).append("hotel", this.hotel).append(
				"tourId", this.tourId).append("content", this.content).append(
				"comments", this.comments).append("name", this.name).append(
				"dinner", this.dinner).append("id", this.id).toString();
	}
}
